cea4e4f05f721fb331e469b38943915e7f33d1c7,main/java/PowerPaint/src/com/kreative/paint/io/CKPGradientSerializer.java,CKPGradientSerializer,serializeObject,#Object#DataOutputStream#,42
Before Change
stream.writeBoolean(v.repeat);
stream.writeBoolean(v.reflect);
stream.writeBoolean(v.reverse);
stream.writeUTF(v.name);
}
}
After Change
addTypeAndClass(TYPE_GRADIENT_SHAPE_RECTANGULAR, 2, GradientShape.Rectangular.class);
}
public void serializeObject(Object o, DataOutputStream stream) throws IOException {
if (o instanceof GradientColor.RGB) {
GradientColor.RGB v = (GradientColor.RGB)o;
stream.writeByte(v.r);
stream.writeByte(v.g);
stream.writeByte(v.b);
} else if (o instanceof GradientColor.RGB16) {
GradientColor.RGB16 v = (GradientColor.RGB16)o;
stream.writeShort(v.r);
stream.writeShort(v.g);
stream.writeShort(v.b);
} else if (o instanceof GradientColor.RGBA) {
GradientColor.RGBA v = (GradientColor.RGBA)o;
stream.writeByte(v.r);
stream.writeByte(v.g);
stream.writeByte(v.b);
stream.writeByte(v.a);
} else if (o instanceof GradientColor.RGBA16) {
GradientColor.RGBA16 v = (GradientColor.RGBA16)o;
stream.writeShort(v.r);
stream.writeShort(v.g);
stream.writeShort(v.b);
stream.writeShort(v.a);
} else if (o instanceof GradientColor.HSV) {
GradientColor.HSV v = (GradientColor.HSV)o;
stream.writeFloat(v.h);
stream.writeFloat(v.s);
stream.writeFloat(v.v);
} else if (o instanceof GradientColor.HSVA) {
GradientColor.HSVA v = (GradientColor.HSVA)o;
stream.writeFloat(v.h);
stream.writeFloat(v.s);
stream.writeFloat(v.v);
stream.writeFloat(v.a);
} else if (o instanceof GradientColorMap) {
GradientColorMap v = (GradientColorMap)o;
stream.writeUTF((v.name != null) ? v.name : "");
stream.writeInt(v.size());
for (GradientColorStop stop : v) {
SerializationManager.writeObject(stop, stream);
}
} else if (o instanceof GradientColorStop) {
GradientColorStop v = (GradientColorStop)o;
stream.writeDouble(v.position);
SerializationManager.writeObject(v.color, stream);
} else if (o instanceof GradientList) {
GradientList v = (GradientList)o;
stream.writeUTF((v.name != null) ? v.name : "");
stream.writeInt(v.presets.size());
stream.writeInt(v.shapes.size());
stream.writeInt(v.colorMaps.size());
for (GradientPreset preset : v.presets) {
SerializationManager.writeObject(preset, stream);
}
for (GradientShape shape : v.shapes) {
SerializationManager.writeObject(shape, stream);
}
for (GradientColorMap colorMap : v.colorMaps) {
SerializationManager.writeObject(colorMap, stream);
}
} else if (o instanceof GradientPaint2) {
GradientPaint2 v = (GradientPaint2)o;
SerializationManager.writeObject(v.shape, stream);
SerializationManager.writeObject(v.colorMap, stream);
SerializationManager.writeObject(v.boundingRect, stream);
} else if (o instanceof GradientPreset) {
GradientPreset v = (GradientPreset)o;
stream.writeUTF((v.name != null) ? v.name : "");
SerializationManager.writeObject(v.shape, stream);
SerializationManager.writeObject(v.colorMap, stream);
} else if (o instanceof GradientShape.Linear) {
GradientShape.Linear v = (GradientShape.Linear)o;
stream.writeDouble(v.x0);
stream.writeDouble(v.y0);
stream.writeDouble(v.x1);
stream.writeDouble(v.y1);
stream.writeBoolean(v.repeat);
stream.writeBoolean(v.reflect);
stream.writeBoolean(v.reverse);
stream.writeUTF((v.name != null) ? v.name : "");
} else if (o instanceof GradientShape.Angular) {
GradientShape.Angular v = (GradientShape.Angular)o;
stream.writeDouble(v.cx);